<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Connect {

	/**
	 * Constructor
	 *
	 * @access	public
	 */
	public function __construct()
	{
		/*$CI =& get_instance();
		$phone_number 	= $CI->session->userdata('phone_number');
		
		$router 		= & load_class('Router', 'core');
		$controller_name= $router->fetch_class();
	
		if(!$phone_number && $controller_name != 'login')
		{
			redirect(site_url().'/login', 'location', 302);
		}*/
	}
	
	/**
	 * getHTTPContent
	 */
	public function getHTTPContent($strLink)
	{
		$curl_handle = curl_init();
		curl_setopt($curl_handle,CURLOPT_URL,$strLink);
		curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
		curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
		$strContent = curl_exec($curl_handle);
		curl_close($curl_handle);
		
		return $strContent;
		//return 'ACK:1001,1:::';
		
	}
	
	/**
	 * Get message
	 */
	public function message($message = '', $type = 'success')
	{
		if($type == 'error')
		{
			$html = '<div class="nNote nFailure hideit" id="notification_message">
						<p><strong>FAILURE: </strong>'.$message.'</p>
					</div>';
		}
		elseif($type == 'info')
		{
			$html = '<div class="nNote nInformation hideit" id="notification_message">
						<p><strong>INFORMATION: </strong>'.$message.'</p>
					</div>';
		}
		elseif($type == 'warning')
		{
			$html = '<div class="nNote nWarning hideit" id="notification_message">
						<p><strong>WARNING: </strong>'.$message.'</p>
					</div>';
		}
		else
		{
			$html = '<div class="nNote nSuccess hideit" id="notification_message">
						<p><strong>SUCCESS: </strong>'.$message.'</p>
					</div>';
		}
		
		/*$html .= '<script>						
					//$(document).ready(function(){
						setTimeout(hideNotificationMessage,3000);
						function hideNotificationMessage()
							$("#notification_message").trigger("click");
					//});
				</script>
					';*/
		return $html;
	}
}


/* End of file connect.php */
/* Location: ./application/libraries/connect.php */